<?php
$this->menu = array(
	array('label'=>'新建枚举类型', 'url'=>array('edit'), 'visible'=>Yii::app()->user->v('manage@EnumsEdit')),
);
echo CHtml::tag('h2', array(), '枚举管理列表');
$table = new YDataGrid($list, array(
	'columns' => array(
		'name',
		'code',
		'items',
	),
	'key' => '_id'
));

class ItemsCell extends YDataGridCell{
	public function render() {
		$html = '';
		foreach ($this->cell_data as $index=>$name){
			$html .= '【' . $index . '】' . $name . '<br>';
		}
		return $html;
	}
}

$table
->setTitles(array('名称', '代码', '元素'))
->setColumnValues(array(
	'C' => new ItemsCell()
))
->insertCol(0, array(
	YHtmlDataGrid::link('编辑', '/manage/enums/edit/{$key}', array('visible'=>Yii::app()->user->v('manage@EnumsAdmin'))),
		YHtmlDataGrid::jsLink('删除', 'del', array('visible'=>Yii::app()->user->v('manage@EnumsDel'))),
), '操作')
->render(false);